package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.CstCounterpartyMapper;
import com.ruoyi.system.domain.CstCounterparty;
import com.ruoyi.system.service.ICstCounterpartyService;

/**
 * 合同对方Service业务层处理
 * 
 * @author zjw
 * @date 2023-01-04
 */
@Service
public class CstCounterpartyServiceImpl implements ICstCounterpartyService 
{
    @Autowired
    private CstCounterpartyMapper cstCounterpartyMapper;

    /**
     * 查询合同对方
     * 
     * @param counterpartyId 合同对方主键
     * @return 合同对方
     */
    @Override
    public CstCounterparty selectCstCounterpartyByCounterpartyId(Long counterpartyId)
    {
        return cstCounterpartyMapper.selectCstCounterpartyByCounterpartyId(counterpartyId);
    }

    /**
     * 查询合同对方列表
     * 
     * @param cstCounterparty 合同对方
     * @return 合同对方
     */
    @Override
    public List<CstCounterparty> selectCstCounterpartyList(CstCounterparty cstCounterparty)
    {
        return cstCounterpartyMapper.selectCstCounterpartyList(cstCounterparty);
    }

    /**
     * 新增合同对方
     * 
     * @param cstCounterparty 合同对方
     * @return 结果
     */
    @Override
    public int insertCstCounterparty(CstCounterparty cstCounterparty)
    {
        return cstCounterpartyMapper.insertCstCounterparty(cstCounterparty);
    }

    /**
     * 修改合同对方
     * 
     * @param cstCounterparty 合同对方
     * @return 结果
     */
    @Override
    public int updateCstCounterparty(CstCounterparty cstCounterparty)
    {
        return cstCounterpartyMapper.updateCstCounterparty(cstCounterparty);
    }

    /**
     * 批量删除合同对方
     * 
     * @param counterpartyIds 需要删除的合同对方主键
     * @return 结果
     */
    @Override
    public int deleteCstCounterpartyByCounterpartyIds(Long[] counterpartyIds)
    {
        return cstCounterpartyMapper.deleteCstCounterpartyByCounterpartyIds(counterpartyIds);
    }

    /**
     * 删除合同对方信息
     * 
     * @param counterpartyId 合同对方主键
     * @return 结果
     */
    @Override
    public int deleteCstCounterpartyByCounterpartyId(Long counterpartyId)
    {
        return cstCounterpartyMapper.deleteCstCounterpartyByCounterpartyId(counterpartyId);
    }
}
